package cn.tedu.spring;

import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestIOC {
    //单元测试：用来测试程序的。@Test + void +没有参数 + public
    @Test
    public void ioc(){
        //1.加载spring的核心配置文件
        ClassPathXmlApplicationContext spring = new ClassPathXmlApplicationContext("spring-config.xml");
        //2.从spring容器中获取bean对象--ioc
        Object o = spring.getBean("hello");
        Object o2 = spring.getBean("hello");
        System.out.println(o==o2);
    }
}
